<ul class="nav nav-tabs" role="tablist">
  <li><a href="<?php echo $this -> url('home', array('action' => 'main')); ?>">Back to Main Menu</a></li>
  <li><a href="<?php echo $this -> url('insert', array('action' => 'insert')); ?>">New Item</a></li>
  <li><a href="<?php echo $this -> url('transaksi', array('action' => 'transaksi')); ?>">Transaksi</a></li>
  <li class="active"><a href="<?php echo $this -> url('report', array('action' => 'report')); ?>">Report</a></li>
  <li ><a href="<?php echo $this -> url('login/logout', array('action' => 'logout')); ?>">Logout</a></li>
</ul>

<br>
<a href="<?php echo $this->url('report/excel', array('action'=>'excel'));?>">Export to Excel File</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?php echo $this->url('report/pdf', array('action'=>'pdf'));?>">Export to PDF File</a>

&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?php echo $this->url('report/chart', array('action'=>'chart'));?>">Export to Excel with Chart</a>
<br>
<br>
<?php foreach($reportData as $transaksi) : ?>
	
<h4>
	<?php echo 'Id Transaksi : ' . $transaksi['transaksiData']['idTransaksi'];?><br>
	<?php echo 'User : ' . $transaksi['transaksiData']['user'];?><br>
	
	<?php 
	
	echo 'Tanggal : ' . date("g:i a F j, Y ", strtotime($transaksi['transaksiData']['tglTransaksi']));?><br>
</h4>
<Table class='table table-striped'>
	<tr>
		<th>
			Nama Barang
		</th>
		<th>
			Harga Barang
		</th>
		<th>
			Jumlah Beli
		</th>
		<th>
			Total
		</th>	
	</tr>
<?php foreach($transaksi['detailTransaksi'] as $detail) : ?>
	<tr>
		<td>
			<?php echo $detail['namaBarang']; ?> 
		</td>
		<td>
			<?php echo $detail['harga']; ?> 
		</td>
		<td>
			<?php echo $detail['jumlah']; ?> 
		</td>
		<td>
			<?php echo $detail['total'];?> 
		</td>
	</tr>
<?php endforeach; ?>
	<tr>
		<td>
			&nbsp;&nbsp;
		</td>
		<td>
			&nbsp;&nbsp;
		</td>
		<td>
			Total : 
		</td>
		<td>
			<?php echo $transaksi['transaksiData']['total'];?>
		</td>
	</tr>
</Table>
<br>
<br>
<?php endforeach; ?>
<br>

<h4>
<?php
if ($this -> messages) {
	
	foreach ($this->messages as $message) {
		echo $message;
		echo "<BR>";
	}

}
?>
</h4>

